package com.tan.kotlintest.adapter

import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import com.tan.kotlintest.R
import com.tan.kotlintest.base.BaseActivity
import java.util.*

/*
 * Copyright (C) 2018
 * 版权所有
 *
 * 功能描述:  Snap recycler adapter
 * 作者：txj
 * 创建时间：2018/11/27
 *
 * 修改人：
 * 修改描述：
 * 修改日期
 */
class SnapRecyclerAdapter(private var mContext: BaseActivity?) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {

    private var mBeans: List<String> = ArrayList()

    fun loadData(beans: List<String>) {
        mBeans = beans
        notifyDataSetChanged()
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
        val view = LayoutInflater.from(mContext).inflate(R.layout.item_snap_recycler_layout, parent, false)
        return MyViewHolder(view)
    }

    override fun getItemCount(): Int {
        return mBeans.size
    }

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {

    }

    inner class MyViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {

        var content_iv: ImageView = itemView.findViewById(R.id.content_iv)
    }

}